/*
*Copyright (c) Nikhil Jain.
*Project ICARUS, communications and 
*artificial intelligence.
*/



package javadrone.remotepackage;

//~--- non-JDK imports --------------------------------------------------------

import simbad.sim.EnvironmentDescription;

//~--- JDK imports ------------------------------------------------------------

import java.io.Serializable;

import java.util.ArrayList;

import javax.vecmath.Color3f;
import javax.vecmath.Vector3d;

public class RemoteEnvironmentDescription implements Serializable {
    public final static int NORMALS_REALISTIC = 2;
    public final static int NORMALS_SIMPLE    = 1;

    // configurable values
    public Color3f  ambientLightColor;
    public Color3f  archColor;
    public Color3f  backgroundColor;
    public Color3f  boxColor;
    public Color3f  floorColor;
    public boolean  hasAxis;
    public Color3f  light1Color;
    public boolean  light1IsOn;
    public Vector3d light1Position;
    public Color3f  light2Color;
    public boolean  light2IsOn;
    public Vector3d light2Position;
    public int      normalsStyle;
    ArrayList       objects;

    /** if true the simulator uses physical laws. */
    public boolean usePhysics;
    public Color3f wallColor;
    public Color3f white, black, red, green, blue, ligthgray, gray, darkgray;

    /** The size of the square containing the world */
    public float worldSize;
    public int   worldViewPoint;

    public RemoteEnvironmentDescription(EnvironmentDescription ed) {
        this.ambientLightColor = ed.ambientLightColor;
        this.light1IsOn        = ed.light1IsOn;
        this.light1Color       = ed.light1Color;
        this.light1Position    = ed.light1Position;
        this.light2Color       = ed.light2Color;
        this.light2IsOn        = ed.light2IsOn;
        this.light2Position    = ed.light2Position;
        this.wallColor         = ed.wallColor;
        this.archColor         = ed.archColor;
        this.boxColor          = ed.boxColor;
        this.floorColor        = ed.floorColor;
        this.backgroundColor   = ed.backgroundColor;
        this.worldViewPoint    = ed.worldViewPoint;
        this.hasAxis           = ed.hasAxis;
        this.normalsStyle      = ed.normalsStyle;
        this.usePhysics        = ed.usePhysics;
        this.worldSize         = ed.worldSize;
    }

    public EnvironmentDescription build() {
        EnvironmentDescription ed = new EnvironmentDescription();

        ed.ambientLightColor = this.ambientLightColor;
        ed.light1IsOn        = this.light1IsOn;
        ed.light1Color       = this.light1Color;
        ed.light1Position    = this.light1Position;
        ed.light2Color       = this.light2Color;
        ed.light2IsOn        = this.light2IsOn;
        ed.light2Position    = this.light2Position;
        ed.wallColor         = this.wallColor;
        ed.archColor         = this.archColor;
        ed.boxColor          = this.boxColor;
        ed.floorColor        = this.floorColor;
        ed.backgroundColor   = this.backgroundColor;
        ed.worldSize         = this.worldSize;
        ed.worldViewPoint    = this.worldViewPoint;
        ed.hasAxis           = this.hasAxis;
        ed.normalsStyle      = this.normalsStyle;
        ed.usePhysics        = this.usePhysics;

        return ed;
    }

    public void fill(EnvironmentDescription ed) {
        ed.ambientLightColor = this.ambientLightColor;
        ed.light1IsOn        = this.light1IsOn;
        ed.light1Color       = this.light1Color;
        ed.light1Position    = this.light1Position;
        ed.light2Color       = this.light2Color;
        ed.light2IsOn        = this.light2IsOn;
        ed.light2Position    = this.light2Position;
        ed.wallColor         = this.wallColor;
        ed.archColor         = this.archColor;
        ed.boxColor          = this.boxColor;
        ed.floorColor        = this.floorColor;
        ed.backgroundColor   = this.backgroundColor;
        ed.worldSize         = this.worldSize;
        ed.worldViewPoint    = this.worldViewPoint;
        ed.hasAxis           = this.hasAxis;
        ed.normalsStyle      = this.normalsStyle;
        ed.usePhysics        = this.usePhysics;
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
